using DapperExtensions.Mapper;

namespace Read.Models
{
    /// <summary>
    /// 字段映射
    /// </summary>
    public class RoleMapper : ClassMapper<RoleModel>
    {
        public RoleMapper()
        {
            Table(Tables.Role);
            Map(c => c.Id).Column("Id").Key(KeyType.Identity);
            Map(c => c.Pid).Column("Pid");
            Map(c => c.Name).Column("Name");
            Map(c => c.Status).Column("Status");
            Map(c => c.Remark).Column("Remark");
            Map(c => c.Sort).Column("Sort");
            Map(c => c.CreateTime).Column("CreateTime");
            Map(c => c.UpdateTime).Column("UpdateTime");
        }
    }
    /// <summary>
    /// 角色类
    /// </summary>
    public class RoleModel
    {
        /// <summary>
        /// 节点Id
        /// </summary>
        public int Id { get; set; }

        /// <summary>
        /// 上级Id
        /// </summary>
        public int Pid { get; set; }

        /// <summary>
        /// 角色名
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 状态
        /// </summary>
        public int Status { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public int CreateTime { get; set; }

        /// <summary>
        /// 更新时间
        /// </summary>
        public int UpdateTime { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        public string Remark { get; set; }

        /// <summary>
        /// 排序
        /// </summary>
        public int Sort { get; set; }
    }
}